function doSomethingWithData(data) {
   // alert(data);
}

function closeDialog(){
  $(".popup").dialog('close');	
}


$(function () {
 
  
  $('.thickbox').bind('click', function(event) {
    var rand, url, title;

    $('.popup').empty();
    event.preventDefault();

    rand =  Math.random()*99999;
    url = $(this).attr("href");
    title = $(this).attr("title");

    $('.popup').dialog({
	
        modal: true,
        open: function ()
        {
            $('.popup').load(url + '&t=' + rand,doSomethingWithData);
		
        },         
        height: 500,
        width: 700,
        title: title
    });
	 
  });
	  
});
